


public class Opdracht32
{

	public static void main(String[] args)
	{
        char[] lol = new char[10];
    	perm1(lol , "abc",0);


	}
	
    public static void SchrijfPermutaties(String s)
    {
        char[] lol = new char[10];
        perm1(lol, s,0);
    }

	private static void perm1(char[] seq, String s, int m)
	{

		int n = s.length();
		if(n == 0)
		{
			for(int i = 0; i < seq.length; i++)
				System.out.print(seq[i]);
			System.out.println();
		}

		else
		for (int i = 0; i < n; i++)
		{

            seq[m] = s.charAt(i);
            m = m +1;
			perm1(seq, s.substring(0, i) + s.substring(i+1, n),m);
			m = m -1;
  		}
    }

}
